<!DOCTYPE html>
<html>
{include file="head.html"}

<body>
 
<div class="tabs-border">
	<a class="item active" href="{$appadmin}?m=module">插件列表</a>
	<a class="item" href="http://www.deituicms.com/module.php?m=down" target="_blank">应用商店</a>
</div>
<div class="main-body">
 
<table  class="tbs">
<thead>
	<tr>
		<td>插件名称</td>
		<td>插件描述</td>
		<td>操作</td>
	</tr>
</thead>	 
<tr>
	{foreach item=c from=$mods}
	<td width="15%">{$c.title}</td>
	<td width=" ">{$c.info}</td>
	<td width="22%">
	{if $c.isinstall}
	<a href='javascript:;' class="cl-danger" onclick="if(confirm('确认卸载插件吗？')){window.location.href='{$appadmin}?m=module&a=uninstall&inmodule={$c.module}';}">卸载插件</a>
	
	<a href="/module.php?m={$c.module}" target="_blank">查看</a>
	<a href="javascript:;" onclick="window.parent.goPluginMenu('{$c.adminurl}')" >管理</a>
	<a href="javascript:;" class="js-nav-add" title="{$c.title}" url='{$c.adminurl}' >添加到导航</a> 
	<a href="{$appadmin}?m=module&a=update&inmodule={$c.module}">更新</a>  
	{else}<a href='{$appadmin}?m=module&a=install&inmodule={$c.module}'>安装</a>{/if}
	 
	 
	</td>
</tr>
{/foreach}
</table>
</div>

{include file='footer.html'}
<script>
$(function(){
	$(document).on("click","#yun_app_install",function(){
		$.post("{$appadmin}?m=module&a=DownInstall&ajax=1&downcode="+$("#downcode").val(),function(data){
			if(data.error){
				skyToast(data.message);
			}else{
				skyToast(data.message);
			}
		},"json");
	});
	
	$(document).on("click",".js-nav-add",function(e){
		var url=$(this).attr("url");
		var title=$(this).attr("title");
		$.ajax({
			url:"/admin.php?m=module&a=navadd&ajax=1",
			dataType:"json",
			type:"POST",
			data:{
				url:url,
				title:title
			},
			success:function(res){
				skyToast(res.message)
			}
		})
	}) 
	
});
</script>
</body>
</html>